package com.jt.demo7;

public class Car {

    private String name;
    private String color;

    //以后写方法时,先写无参构造
    public  Car(){
        System.out.println("我是无参构造方法");
    }

    public Car(String name, String color) {
        this.name = name;
        this.color = color;

    }

    public void go(){
        System.out.println("飞跑"+name+":"+color);
    }
}
